/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package openfireconnection;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import openfireconnection.group.ManejadorGroups;
import openfireconnection.group.impl.ManejadorGroupsImpl;
import openfireconnection.group.model.GroupModel;
import openfireconnection.group.model.MemberModel;

/**
 *
 * @author Miguel y Juanan - Telecor
 */
public class OpenFireConnection {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        ManejadorGroups manejadorGrupos = null;
        
        manejadorGrupos = new ManejadorGroupsImpl();
        
        ArrayList<String> gruposXMPP = manejadorGrupos.getGroupsNames();
        
        for(String groupXMPP : gruposXMPP) {
            System.out.println(groupXMPP);
        }
        /**
        System.out.println(manejadorGrupos.getCountGroups());
        
        System.out.println(manejadorGrupos.getGroupDescription("gagen2t3g"));
        
        Map mapProperty = new HashMap<String, String>();
        mapProperty.put("groupName", "gru1");
        mapProperty.put("propertyName", "sharedRoster.displayName");
        System.out.println("sharedRoster.displayName de gru1: " +
                manejadorGrupos.getGroupProperty(mapProperty));
        
        Map mapNewName = new HashMap<String, String>();
        mapNewName.put("groupName", "gru1_nuevo");
        mapNewName.put("groupNameNew", "gru1");
        System.out.println("Columnas actualizadas: " +
                manejadorGrupos.updateGroupName(mapNewName));
        
        MemberModel memberModel = new MemberModel("grea");
        memberModel.setAdministrator("1");
        memberModel.setGroupName("gru1");
        System.out.println("Actualizado miembro: " + manejadorGrupos.updateGroupMember(memberModel));
        
        System.out.println("Insertado grupo: " + manejadorGrupos.insertGroupMember(memberModel));
        
        GroupModel groupModel = new GroupModel("GrupoPrueba");
        groupModel.setDescription("Descripcion GrupoPrueba");
        manejadorGrupos.insertGroup(groupModel);
        
        */
    }
}
